<%-- 
    Document   : viewassignment
    Created on : Mar 13, 2010, 10:55:49 AM
    Author     : 06c51a1217
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

  <%@page import="java.sql.*" %>
<html>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
  <body bgcolor="white"   text="black">
  //<img src="course portal1.jpg" width="1400" height="120" alt="course portal1"/>

  <center><i><u><font size="17">view assignment</font></u></i></center>  
       <table>
    <tr>        
    <td>
 <table border="4"  cellspacing="7" cellpadding="7">
<tbody>
<tr>
    <td><a href="viewall.jsp">VIEWCOURSES</a></td>

</tr>
<tr>
    <td><a href="facultydiscussionforum.jsp">DISCUSSIONFORUM</a></td>

</tr>
<tr>
    <td><a href="facultyuploadmaterial.jsp">UPLOADMATERIAL</a></td>

</tr>
<tr>
    <td><a href="facultyuploadassignment.jsp">UPLOAD ASSIGNMENT</a></td>

</tr>

<tr>
    <td><a href="facultyviewmaterial.jsp">VIEWMATERIAL</a></td>
</tr>
<tr>
    <td><a href="facultyviewassignment.jsp">VIEWASSIGNMENT</a></td>
</tr>
<tr>
<td><a href="home.jsp">SIGNOUT</a></td>
</tr>
</tbody>
</table>
</td>
<td width=860>

 
 <br><br><br>

<form action="facultyviewassignment.jsp" method="POST">
   <center>
 <table border="0" align="center">
<tbody>
<tr>
<td width=160>Select course:</td>
<td>
    <select name="course_id">
    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("Jdbc:Odbc:oradsn","system","system");
Statement st=con.createStatement();
String username=(String)session.getAttribute("username");
ResultSet rs=st.executeQuery("select courseid,coursename from course");

while(rs.next())
    {
    %>
    <option value=<%=rs.getString("courseid")%>><%=rs.getString("coursename")%></option>
    <%
    }
    %>
</select></td>
</tr>
<tr>
    <td><input type="submit" value="submit" /></td>
    <td><input type="reset" value="reset" /></td>
</tr>
</table>
</center>

</form>
 </center><br><br>
      <center>

<table  border="1">
    <%
    String ci=request.getParameter("courseid");
   
    if(ci!=null)
        {
    int course_id=Integer.parseInt(ci);
    
    Statement st1=con.createStatement();
    ResultSet rs1=st1.executeQuery("select * from course_material where course_id= "+course_id);
    while(rs1.next())
        {
        
    %>
    <tr>
        <td>
            <a href="<%=rs1.getString("location")%>"><%=rs1.getString("title")%></a>
        </td>
        <td>
            <%=rs1.getString("description")%>
        </td>
    </tr>
    <%
    }
    }
    %>
    </center>
</table>
</td>
</tr>
</table>

  </body>
</html>

